/*
 * Created on January 7, 2005
 *
 * Copyright (c) Patrick Armstrong 2002-2007. All Rights Reserved
 */
package org.dime.mine.game;


/**
 * Board // TODO Add type summary
 * 
 * @author Owner
 */
public interface Board
{
    /** Indicates that a location is open and is a mine */
    public final static int MINE = 9;

    /** Indicates that a location is marked */
    public final static int MARKED = -2;

    /** Indicates that a location is neither marked nor open */
    public final static int NOT_OPEN = -1;

    /**
     * Opens the location at the given row and column. If the specified location
     * is either marked or already open then the location's state will not be
     * changed.
     * 
     * @param row
     *            the row of the location
     * @param column
     *            the column of the location
     * 
     * @see Board#check(int, int)
     */
    public abstract void open(int row, int column);

    public abstract int check(int row, int column);

    /**
     * Sets the mark state of the location at the given row and column to the
     * value of <code>marked</code>. If the specified location is already
     * open then the location's state will not be changed.
     * 
     * @param row
     *            the row of the location
     * @param column
     *            the column of the location
     * @param marked
     *            the new mark state
     * 
     * @see Board#check(int, int)
     */
    public abstract void setMarked(int row, int column, boolean marked);

    public abstract Location getLocation(int row, int column);

    public abstract boolean isGameOver();

    public abstract boolean isWon();

    public abstract boolean isLost();

    public abstract int getMines();

    public abstract int getMarks();

    public abstract int getRows();

    public abstract int getColumns();

    /**
     * Location // TODO Add type summary
     * 
     * @author Owner
     */
    public interface Location
    {
        public abstract Board getBoard();

        public abstract int getRow();

        public abstract int getColumn();

        public abstract int getValue();

        public abstract boolean isOpen();

        public abstract boolean isMarked();

        public abstract boolean isSatisfied();

        public abstract void open();

        public abstract void setMarked(boolean marked);
    }
}